package com.chenyue.cm.exception;

import org.apache.commons.lang3.RandomUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OrderNumberRule {

    public static String execute() {
        //指定前缀
        String prefix = "JD";
        //时间戳
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        //生成两位数的随机数
        int random = RandomUtils.nextInt(10, 90) + 10;
        return prefix + format.format(new Date()) + random;
    }
}
